package com.bindapp.model;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.view.LayoutInflater;
import android.widget.CompoundButton;

import com.bindapp.R;
import com.bindapp.databinding.ActivityAmoBinding;

/**
 * Created by apple on 2018/7/9.
 */

public class ControllerAmoModel extends BaseModel {
    private ActivityAmoBinding binding;

    public ControllerAmoModel(Context context) {
        super(context);
        binding= DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.activity_amo,null,false);
        binding.switch2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                binding.statustxt.setText(b?"脉冲":"正常");
                binding.status.setText(b?"(左右滑动切换工作模式)\n脉冲：每30秒停5秒":"(左右滑动切换工作模式)");
            }
        });
    }

    @Override
    public ActivityAmoBinding getBinding() {
        return binding;
    }
}
